//
//  ViewController.m
//  01-homework-拉钩
//
//  Created by 402030900@qq.com on 16/7/14.
//  Copyright © 2016年 402030900@qq.com. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // 背景
    UIImageView *imageBack = [[UIImageView alloc] initWithFrame:self.view.frame];
    imageBack.image = [UIImage imageNamed:@"welcome_2.jpg"];
    [self.view addSubview:imageBack];
    imageBack.alpha = 0.7;
    // 拉钩图标
    UIImageView *lagouImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 150)];
    lagouImage.center = CGPointMake(375 / 2 , 220);
    lagouImage.backgroundColor = [UIColor clearColor];
    [self.view addSubview:lagouImage];
    lagouImage.image = [UIImage imageNamed:@"logo_lagou"];
    //圆角
    UIView *corner = [[UIView alloc] initWithFrame:CGRectMake(10, 320 , 315 + 40, 85)];
    corner.backgroundColor = [UIColor clearColor];
    [self.view addSubview:corner];
    corner.layer.cornerRadius = 5;
    corner.clipsToBounds = YES;
    
    // 用户文本框
    //图标
    UIImageView *userImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
    userImage.backgroundColor = [UIColor blackColor];
    [corner addSubview:userImage];
    userImage.alpha = 0.7;
    userImage.image = [UIImage imageNamed:@"icon_username"];
    //文本框
    UITextField *userText = [[UITextField alloc] initWithFrame:CGRectMake(40, 0, 375 - 60, 40)];
    userText.backgroundColor = [UIColor blackColor];
    [corner addSubview:userText];
    userText.alpha = 0.4;
    // 密码文本框
    // 图标
    UIImageView *passImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 45, 40, 40)];
    passImage.backgroundColor = [UIColor blackColor];
    [corner addSubview:passImage];
    passImage.alpha = 0.7;
    passImage.image = [UIImage imageNamed:@"icon_password-1"];
    // 文本框
    UITextField *passText = [[UITextField alloc] initWithFrame:CGRectMake(40, 45, 375 - 60, 40)];
    passText.backgroundColor = [UIColor blackColor];
    [corner addSubview:passText];
    passText.alpha = 0.4;
    // 登录
    UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeSystem];
    loginButton.frame = CGRectMake(10, 422, 375 - 20, 40);
    [loginButton setTitle:@"登录" forState:UIControlStateNormal];
    [self.view addSubview:loginButton];
    loginButton.backgroundColor = [UIColor colorWithRed:64 / 255.0 green:169 / 255.0 blue:116 / 255.0 alpha:1];
    [loginButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    // 忘记密码
    UIButton *forgetPass =[UIButton buttonWithType:UIButtonTypeSystem];
    [forgetPass setFrame:CGRectMake(0, 482, 100, 40)];
    forgetPass.backgroundColor = [UIColor clearColor];
    [self.view addSubview:forgetPass];
    [forgetPass setTitle:@"忘记密码" forState:UIControlStateNormal];
    [forgetPass setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    // 现在注册拉钩
    UIButton *momentRegister =[UIButton buttonWithType:UIButtonTypeSystem];
    [momentRegister setFrame:CGRectMake(0, 0, 140, 40)];
    momentRegister.center = CGPointMake(375/2, 550);
    momentRegister.backgroundColor = [UIColor clearColor];
    [self.view addSubview:momentRegister];
    [momentRegister setTitle:@"现在注册拉钩" forState:UIControlStateNormal];
    [momentRegister setTitleColor:[UIColor colorWithRed:64 / 255.0 green:169 / 255.0 blue:116 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    momentRegister.titleLabel.font = [UIFont boldSystemFontOfSize:18];// 加粗
    //----or----
    //----
    UIImageView *orLineLeft = [[UIImageView alloc] initWithFrame:CGRectMake(10, 580, 150, 1)];
    orLineLeft.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:orLineLeft];
    //----
    UIImageView *orLineRight = [[UIImageView alloc] initWithFrame:CGRectMake(375 - 10 - 150, 580, 150, 1)];
    orLineRight.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:orLineRight];
    //--or--
    UILabel *orLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 60, 30)];
    orLabel.center = CGPointMake(375/2, 580);
    [orLabel setText:@"or"];
    [self.view addSubview:orLabel];
    [orLabel setTextColor:[UIColor whiteColor]];
    orLabel.textAlignment = NSTextAlignmentCenter;
    // 随便逛逛
    UIButton *gogo = [UIButton buttonWithType:UIButtonTypeSystem];
    [gogo setFrame:CGRectMake(0, 0, 100, 40)];
    gogo.center = CGPointMake(375/2, 630);
    gogo.backgroundColor = [UIColor clearColor];
    [self.view addSubview:gogo];
    [gogo setTitle:@"随便逛逛>" forState:(UIControlStateNormal)];
    [gogo setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
